package com.bw.demo.model;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.bw.demo.enums.TypeEnum;
import com.bw.demo.valid.anno.EnumValid;

public class UserDto 
{
	@NotBlank(message = "id参数丢失")
	private String id;
	
	@NotBlank(message = "名称不能为空")
	private String name;
	
	@NotNull(message = "年龄不能为空")
	private Integer age;
	
	@EnumValid(target = TypeEnum.class, enumType = "value", message = "状态值非法")
	private String type;
	
	// 添加@Valid，可以对对象进行级联校验
	// @Valid
	@NotNull
	private Course course;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}
	
	
}
